home *** CD-ROM | disk | FTP | other *** search
/ Best of Shareware / Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso / mac / DOS / MATH / FSULTRA1 / ULTRX_LH.ASM < prev    next >
Assembly Source File  |  1992-06-18  |  3KB  |  127 lines

  1. comment ! 
  2. FSU - ULTRA    The greatest random number generator that ever was
  3.         or ever will be.  Way beyond Super-Duper.
  4.         (Just kidding, but we think its a good one.)
  5.  
  6. Authors:    Arif Zaman (arif@stat.fsu.edu) and
  7.         George Marsaglia (geo@stat.fsu.edu).
  8.  
  9. Date:        27 May 1992
  10.  
  11. Version:    1.05
  12.  
  13. Copyright:    To obtain permission to incorporate this program into
  14.         any commercial product, please contact the authors at
  15.         the e-mail address given above or at
  16.  
  17.         Department of Statistics and
  18.         Supercomputer Computations Research Institute
  19.         Florida State University
  20.         Tallahassee, FL 32306.
  21.  
  22. See Also:    README        for a brief description
  23.         ULTRA.DOC    for a detailed description
  24.  
  25. -----------------------------------------------------------------------
  26. ;
  27. ; File:  ULTRX_LH.ASM (80386 Lahey F77L calling conventions)
  28. ;
  29.     DOSSEG
  30.    .MODEL HUGE
  31.  
  32. ;===== B: GLOBAL FUNCTIONS, SUBROUTINES and VARIABLES =================
  33. ;
  34.     public  i31bit, i15bit, i7bit,  i1bit,  uni,    duni
  35.     public  i32bit, i16bit, i8bit,  rinit,  vni,    dvni
  36.     public    swbstate, swbsize
  37.  
  38. ;===== D. MACRO DEFINITIONS ===========================================
  39. ;
  40. ; RinitProcStart should take two 32-bit arguments conx and shrx
  41. ;   and place them in eax and ebx.
  42. ;   es and ds should both point to the data segment.
  43. ;   conx must be odd (so we or with 1 just to make sure).
  44. ; FillProc
  45. ;   DS is already the data segment. ES should also be made the same.
  46.  
  47. EnterProcedure   macro
  48.   arg  arg1:dword
  49.     push bp
  50.     mov  bp,sp
  51.     mov  dx,DATA
  52.     mov  ds,dx
  53. endm
  54.  
  55. ExitProcedure    macro
  56.     pop  bp
  57.     ret
  58. endm
  59.  
  60. Enter2arg   macro
  61.     arg conx:dword, shrx:dword
  62.     EnterProcedure
  63.     mov  dx,ds
  64.     lds  si,ConX            ; load conx in eax
  65.     mov  eax,[si]
  66.     shl  eax,1
  67.     or   al,1               ;   (congx must be odd)
  68.     lds  si,ShrX            ; and shrx in ebx
  69.     mov  ebx,[si]
  70.     mov  ds,dx
  71.     mov  es,dx
  72. endm
  73.  
  74. Exit2arg     macro
  75.     ExitProcedure
  76. endm
  77.  
  78. EnterFill    macro
  79.     mov    ax,ds
  80.     mov    es,ax
  81. endm
  82.  
  83. ExitFill    macro
  84.     ret
  85. endm
  86.  
  87. DwordFn macro
  88.     les di,arg1
  89.     stosw
  90.     mov ax,dx
  91.     stosw
  92. endm
  93.  
  94. WordFn  macro
  95.     les di,arg1
  96.     stosw
  97. endm
  98.  
  99. ByteFn  macro
  100.     les di,arg1
  101.     cbw            ; convert bytes to integer*2
  102.     stosw
  103. endm
  104.  
  105. RealFn  macro
  106.     lds  bx,arg1
  107.     fstp dword ptr [bx]
  108. endm
  109.  
  110. DoubleFn macro
  111.     lds  bx,arg1
  112.     fstp qword ptr [bx]
  113. endm
  114.  
  115. DGROUP GROUP DATA
  116. DATA SEGMENT WORD PUBLIC 'DATA'
  117. ASSUME DS:DGROUP
  118.   INCLUDE ULTRADAT.INC
  119. DATA ENDS
  120.  
  121. .STACK 10h
  122.  
  123. .CODE
  124.   INCLUDE ULTRxCOD.INC
  125. END
  126.